<table style="display: inline;"><tr>
<?php
/**
 * @author HIENDV
 * @copyright 2012
 */
session_start();
/**
 * @author HIENDV
 * @copyright 2012
 */
include_once '../../../Model/Account.php';
$user = $_SESSION['username'];
$pass = $_SESSION['password'];
$partner_id=$_SESSION['partner_id'];
$username=$_REQUEST['username'];
$name=$_REQUEST['name'];
$page=$_REQUEST['page'];
$per_page=$_REQUEST['per_page'];
/*$username='';
$name='';
$page=1;
$per_page=10;*/
$acc = new Account($user,$pass);
$rs=$acc->listpage($username,$name,$partner_id,$page,$per_page);
//print_r($rs);
$result='';
for($i=0;$i<count($rs);$i++){
    if($rs[$i]==-1) {
        $j='<img src="lib/images/icon_previous.gif">';
        $result=$result.'<td><span class=paging><a href="javascript:load_menu_list(\''.($rs[1]-1).'\');load_listpage(\''.($rs[1]-1).'\')">'.$j.'</a></span></td>';
    }
    else if($rs[$i]==-2) {
        $j='<img src="lib/images/icon_next.gif">';
       // echo $rs[count($rs)-1];
        $result=$result.'<td ><span class=paging><a href="javascript:load_menu_list(\''.($rs[count($rs)-2]+1).'\');load_listpage(\''.($rs[count($rs)-2]+1).'\')">'.$j.'</a></span></td>';
    }
    else {
        $j=$rs[$i];
        if($j==$page) $class='<td id=page{f01page}><span class=paging ><a style="background-color:#999" href="javascript:load_menu_list(\''.$rs[$i].'\');load_listpage(\''.$j.'\')">'.$j.'</a></span></td>';
        else $class='<td id=page{f01page}><span class=paging><a href="javascript:load_menu_list(\''.$rs[$i].'\');load_listpage(\''.$j.'\')">'.$j.'</a></span></td>';
        $result=$result.$class;
    }
    
}
echo $result;
?>
</tr></table>